<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 容器 [] {} set map weakmap    ; key=>value
    // [] key 只能 number
    // {} key 只能 string
    // map weakMap  key可以是任意类型


    // var map = new Map()
    // map.set({name:'zs'},1)

    // var wmap = new WeakMap()
    // wmap.set({age:18},2)

    {
     
      var map = new Map()
      ;(function(){
        map.set({name:'zs'},1)
        for (const key of map) {
          console.log("key===>",key);
        }
      })();

    }

    {
      var wmap = new WeakMap()
      ;(function(){
        wmap.set({age:18},1)
      })();
    }
 
  </script>
</body>
</html>